/**
 * Created by oureda on 5/29/16.
 */
var superagent = require('superagent');
var superagentPromisePlugin = require('superagent-promise-plugin');
require('es6-promise').polyfill();
var request = superagentPromisePlugin.patch(superagent);
var appkey = '1348ba7dfc35c';
var url = 'https://webapi.sms.mob.com/sms/verify';

module.exports = {
    verify : (phone,code) => {
        return request
            .post(url)
            .set('User-Agent','Mozila 5.0')
            .set('Accept-Encoding','gzip')
            .set('Content-Type',"application/x-www-form-urlencoded")
            .send({appkey:appkey,phone:phone,code:code,zone:'86'});
    }
};
